package com.power.sifa.correction.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;
import com.power.sifa.correction.model.Crw_rule_geopoint;

import javax.transaction.Transactional;
import java.io.Serializable;
import java.util.List;

/**
 * 规则相关范围区域 持久层(hibernate)
 */

public interface Crw_rule_geopointDao extends JpaRepository<Crw_rule_geopoint, Serializable>, JpaSpecificationExecutor<Crw_rule_geopoint>, Repository<Crw_rule_geopoint, Serializable>, Crw_rule_geopointDaoCustom<Crw_rule_geopoint, Serializable> {

   @Modifying
   @Transactional
   @Query("delete  from Crw_rule_geopoint s where  s.id in (:ids) ")
   void removeByIds(@Param("ids") List<String> ids);

   @Query(" from Crw_rule_geopoint s where s.ruleid = :ruleId ")
   List<Crw_rule_geopoint> getByRuleId(@Param("ruleId") String ruleId);

   @Modifying
   @Transactional
   @Query("delete  from Crw_rule_geopoint s where  s.ruleid = :ruleId ")
   void removeByRuleId(@Param("ruleId") String ruleId);
}
